<?php if(null === $this->post || empty($this->post)): ?>
	<div class="head">Ошибка</div>
	<div class="cont_body" style="padding: 10px">
		Постов в данном категории больше нет.
		<div class="clear"></div>
	</div>
<?php else: ?>
<div class="head"><div class="title"><?php echo $this->post['title']; ?></div><p style="margin: 0px;"><?php echo $this->post['description']; ?></p></div>
<div class="cont_body">
	<div style="text-align: center; padding: 10px;">
		<?php 
			$src = $this->post['image_url'];
			if(is_file($_SERVER['DOCUMENT_ROOT'] . '/images/post/' . $this->post['id'] . '.jpg')){
				$src = '/images/post/' . $this->post['id'] . '.jpg';
			}
		?>
		<img id="post_img" width="550" src="<?php echo $src ?>" data-simple="<?php echo $this->post['image_url']; ?>" style="cursor: pointer"/>
	</div>
	<table class="table">
		<tr>
			<td width="200">Рейтинг: </td>
			<td><?php echo $this->post['external_rating']; ?></td>
		</tr>
		<?php if('' !== $this->post['external_votes']): ?>
			<tr>
				<td>Голосов: </td>
				<td><?php echo $this->post['external_votes']; ?></td>
			</tr>
		<?php endif; ?>
		<tr>
			<td>Пост был создан: </td>
			<td><?php echo $this->post['external_created_at']; ?></td>
		</tr>
		<tr>
			<td>Добавлен в базу: </td>
			<td><?php echo $this->post['created_at']; ?></td>
		</tr>
		<tr>
			<td>Тэги: </td>
			<td><?php echo $this->post['tag']; ?></td>
		</tr>
		<tr>
			<td>Внешняя ссылка на пост: </td>
			<td><a href="<?php echo $this->post['external_url']; ?>" target="blank">Перейти</a></td>
		</tr>
	</table>
	<input type="hidden" id="pid" value="<?php echo $this->post['id']; ?>"/>
<div class="clear"></div></div>
<?php endif; ?>